// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch;

/// <summary>
/// <para>
/// Slices configuration used to parallelize a process.
/// </para>
/// </summary>
[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SlicesConverter))]
public sealed partial class Slices : Elastic.Clients.Elasticsearch.Union<int, Elastic.Clients.Elasticsearch.SlicesCalculation>
{
	public Slices(int value) : base(value)
	{
	}

	public Slices(Elastic.Clients.Elasticsearch.SlicesCalculation value) : base(value)
	{
	}

	public static implicit operator Elastic.Clients.Elasticsearch.Slices(int value) => new Elastic.Clients.Elasticsearch.Slices(value);
	public static implicit operator Elastic.Clients.Elasticsearch.Slices(Elastic.Clients.Elasticsearch.SlicesCalculation value) => new Elastic.Clients.Elasticsearch.Slices(value);
}

public readonly partial struct SlicesFactory
{
	public Elastic.Clients.Elasticsearch.Slices Value(int value)
	{
		return new Elastic.Clients.Elasticsearch.Slices(value);
	}

	public Elastic.Clients.Elasticsearch.Slices Computed(Elastic.Clients.Elasticsearch.SlicesCalculation value)
	{
		return new Elastic.Clients.Elasticsearch.Slices(value);
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.Slices Build(System.Func<Elastic.Clients.Elasticsearch.SlicesFactory, Elastic.Clients.Elasticsearch.Slices> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.SlicesFactory();
		return action.Invoke(builder);
	}
}